package com.kapukapu.user.controller;

import com.kapukapu.common.api.user.dto.AuthUserDTO;
import com.kapukapu.user.service.SysUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author sivan
 */
@RestController
public class UserController {

	private final SysUserService sysUserService;

	public UserController(SysUserService sysUserService) {
		this.sysUserService = sysUserService;
	}

	@GetMapping("/login/info")
	public AuthUserDTO getUserByUsername(@RequestParam("username") String username) {
		return sysUserService.getUserByUsername(username);
	}
}
